package qianting.news.article.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import qianting.news.apis.models.article.dtos.CollectionBehaviorDto;
import qianting.news.article.service.ApCollectionService;
import qianting.news.common.entity.State;

@Api(tags = "文章收藏管理")
@RestController
@RequestMapping("/")
public class ArticleCollectionController {

    @Autowired
    private ApCollectionService apCollectionService;

    @ApiOperation(value = "收藏文章和取消收藏")
    @PostMapping("/collection_behavior")
    public State collection(@RequestBody CollectionBehaviorDto dto) {
        return apCollectionService.collection(dto);
    }

}
